import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
const store = new Vuex.Store({
	state:{
		historyList:[]
	},
	mutations:{
		SET_HISTORY(state,payload){
			console.log(payload);
			let obj = {}
			obj.name = payload
			obj.id = Date.now()
			state.historyList.push(obj)
			console.log(state);
		}
	},
	actions:{
		setHistory({commit},history){
			commit("SET_HISTORY",history)
		}
	}
})
export default store